<?php
class SimpleDocFlow
{
    
    static public function getBoolAsString($boolValue)
    {
    	return ($boolValue ? 'Yes' : 'No');
    }
    
	static public function slugify($text)
	{
		// replace all non letters or digits by -
//		$text = preg_replace('/\W+/', '-', $text);
		$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
		$text = trim($text, '-');

		// transliterate
		if (function_exists('iconv'))
			$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
    
		// trim and lowercase
		$text = strtolower($text);

		$text = preg_replace('~[^-\w]+~', '', $text);
		
		if ( empty($text) )
			return 'n-a';
			
		return $text;
	}
	
}
